import java.io.*;

public class Demo {
    public static void main(String[] args) {
        try(OutputStream  outputStream = new FileOutputStream("test.txt")) {
            /*outputStream.write('h');
            outputStream.write('e');
            outputStream.write('l');
            outputStream.write('l');
            outputStream.write('o');*/
            String s = new String("world");
            outputStream.write(s.getBytes());
            outputStream.flush();
        }catch(IOException e) {
            e.printStackTrace();
        }
    }
}
